import api from "@/libs/request";

/**
 * 获取服务信息
 */
export const getSystemServiceInfo = () => {
    return api.get(`/platform/mini-info/service/info`, {});
};

/**
 * 获取基本信息
 */
export const getSystemBaseInfo = () => {
    return api.get(`/platform/mini-info/base/info`, {});
};

/**
 * 获取开发设置
 */
export const getSystemDevelopSetting = () => {
    return api.get(`/platform/mini-info/develop/setting`, {});
};

/**
 * 获取当前租户公众号配置
 */
export const getMiniMpConf = () => {
    return api.get(`/platform/mini-mp-conf`, {});
};

/**
 * 公众号配置添加或修改
 * @param data
 */
export const ModifyMiniMpConf = (data: any) => {
    return api.post(`/platform/mini-mp-conf`, data, {
        headers: {
            "Content-Type": "application/json",
        },
    });
};

/**
 * 获取小程序码,返回base64
 * @param data
 */
export const getWxcode = (data: any) => {
    return api.post(`/platform/mini-info/wxa/getwxacode`, data, {
        headers: {
            "Content-Type": "application/json",
        },
    });
};

/**
 * 获取体验者列表,返回人员对应的唯一字符串
 */
export const getMemberAuthList = () => {
    return api.get(`/platform/mini-experience/wxa/memberauth`, {});
};

/**
 * 解除绑定或绑定体验者
 * @param data
 */
export const setMiniExperience = (data: any) => {
    return api.post(`/platform/mini-experience/wxa/tester`, data, {
        headers: {
            "Content-Type": "application/json",
        },
    });
};

/**
 * 根据租户id获取店铺基本信息
 */
export const getShopInfo = async () => {
    return api.get(`/platform/shop/info`, {});
};

/**
 * 修改电子发票邮箱
 * @param data
 */
export const changeEmail = data => {
    return api.put(`/platform/account-info/email/change`, data, {
        headers: {
            "Content-Type": "application/json",
        },
    });
};
